package day04;

import java.util.Scanner;

public class DoWhile1 {
    public static void main(String[] args) {
        /*  生成随机数  */
        Scanner scan = new Scanner(System.in);
        // Math.random()   生成0.0到0.999999999999...   的随机数
        System.out.println(Math.random());
        // Math.random()*1000+1  生成1到1000之间的随机数
        int num = (int)(Math.random()*1000+1);
        //作弊
        System.out.println(num);

        /* do...while结构 */
        int guess;
        do {
            System.out.println("猜吧!");
            guess = scan.nextInt();
        }while (guess!=num);

    }
}
